package com.log6z.dashborad.enums;


import java.util.Objects;

/**
 * 装车的状态
 */
public interface AppointmentEnum {

    /**
     * 审核状态（0：待审核、10：待运输、20：装货完成、30：卸货待审核、40：任务完成、50：已驳回、60：已取消、70：已释放、80：任务异常、90：手动作废、100：空进空出）
     */
    enum Status {
        PENDING_VERIFY(0, "待审核"),
        PASS_VERIFY(10, "待运输"),
        LOADING_COMPLETE(20, "装货完成"),
        UNLOADING_VERIFY(30, "卸货待审核"),
        TASK_OVER(40, "任务完成"),
        REJECT(50, "已驳回"),
        CANCEL(60, "已取消"),
        RELEASED(70, "已释放"),
        TASK_ABNORMAL(80, "任务异常"),
        MANUAL_VOID(90, "手工作废"),
        EMPTY_IN_EMPTY_OUT(100, "空进空出");

        private Integer status;
        private String msg;
        Status(Integer status, String msg) {
            this.status = status;
            this.msg = msg;
        }
        public Integer getStatus() {
            return status;
        }
        public String getMsg() {
            return msg;
        }
    }

    /**
     * 流程状态：0已预约; 1已打卡; 2已叫号; 3已入场; 4待作业; 5作业完成(已过空磅); 6出场; 7作业异常; 8任务作废'
     */
    enum ProcessStatus {
        OK_APPOINTMENT(0, "已预约"),
        OK_CLOCK(1, "已打卡"),
        CALL_NUMBER(2, "已叫号"),
        IN_FACTORY_AREA(3, "已入场"),
        OPERATION(4, "待作业"),
        OK_OPERATION(5, "作业完成（已过空磅)"),
        OUT_FACTORY_AREA(6, "出场"),
        OPERATION_JOB(7, "作业异常"),
        INVALID_OPERATION(8, "任务作废");

        private Integer value;
        private String label;

        ProcessStatus(Integer value, String label) {
            this.value = value;
            this.label = label;
        }

        public Integer getValue() {
            return value;
        }

        public String getLabel() {
            return label;
        }

        public static AppointmentUnloadEnum.ProcessStatus get(Integer val) {
            AppointmentUnloadEnum.ProcessStatus[] values = AppointmentUnloadEnum.ProcessStatus.values();
            for (AppointmentUnloadEnum.ProcessStatus enu : values) {
                if (Objects.equals(val, enu.getValue())) {
                    return enu;
                }
            }
            return null;
        }
    }
}
